<!DOCTYPE html>

<html>
	<head>
		<link rel="stylesheet" href="../../../themes/themeroller/maemo5-theme/ui.all.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="../../../themes/nokia/ext-theme/maemo5/800x480/custom.css" type="text/css" media="screen" />

		<script src="../../../lib/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
		
		<script src="../../../src/defaults.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../../src/core.js" type="text/javascript" charset="utf-8"></script>

		<style type="text/css" media="screen">
			body {
				font-size: 14px;
				padding: 15px;
				font-family: "Trebuchet MS", "Helvetica", "Arial",  "Verdana", "sans-serif";
				max-width: 800px;
			}

			p {
				margin: 30px 10px;
			}

			#container1 a {
				text-align: center;
				text-decoration: none;
				font-size: 24px;
				margin: 3px;
				width: 125px;
				height: 95px;
				line-height: 90px;
				float: left;
			}
		</style>

	</head>

	<body>

		<h1>Nokia.Sortable - Sample</h1>

		<div id="container1" class="ui-helper-clearfix">
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 1 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 2 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 3 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 4 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 5 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 6 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 7 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 8 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 9 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 10 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 11 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 12 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 13 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 14 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 15 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 16 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 17 </a>
			<a href="javascript:void(0);" class="ui-widget-header ui-state-default"> 18 </a>
		</div>

		<script type="text/javascript" charset="utf-8">		

			var init = function() {
				
				window.sortable1 = new Nokia.Sortable({
					element: '#container1',
					items: '> a',
					selectedClass: 'ui-state-active',
					create: function() {
						console.log("Sortable: Create");
					},
					select: function(event, originalItem, targetItem) {
						console.log("Sortable: Select", event, originalItem, targetItem);
					},
					change: function(event, originalItem, targetItem) {
						console.log("Sortable: Change", event, originalItem, targetItem);
					},
					reset: function(event) {
						console.log("Sortable: Reset", event);
					}
				});

				/*
				 * Hide splash when its all done.
				*/
				
				Nokia.hideSplash();

			};
			
			/*
			 * Show splash while loading components.
			*/
				
			Nokia.showSplash('<span>loading</span>');
			
			Nokia.use('sortable', init);

		</script>

	</body>
</html>